package com.persondemo.videoappliction.ui.adapter;

import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.persondemo.videoappliction.R;
import com.persondemo.videoappliction.bean.ShengtieBean;
import com.persondemo.videoappliction.utils.ImageLoaderUtil;

import java.util.List;

/**
 * Created by Administrator on 2018/4/27.
 */

public class ShengtieAdapter extends BaseQuickAdapter<ShengtieBean.DataBean, BaseViewHolder> {
    private Context context;

    public ShengtieAdapter(@Nullable List<ShengtieBean.DataBean> data, Context context) {
        super(R.layout.item_shengtie, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, ShengtieBean.DataBean item) {
        ImageLoaderUtil.LoadImagelarge(context,item.getAvatar(),helper.getView(R.id.shengtie_user_head));
        helper.setText(R.id.me_shengtie_name, item.getUsername());
        helper.setText(R.id.me_shengtie_comment, item.getContent());
        helper.setText(R.id.me_shengtie_time, item.getTime());
        if (item.getStatus() == 1) {
            helper.setText(R.id.item_shengtie_isagree,"已审核！");
        }else if (item.getStatus()==2){
            helper.setText(R.id.item_shengtie_isagree,"审核中！");
        }else {
            helper.setText(R.id.item_shengtie_isagree,"审核失败！");
        }

    }
}
